public class Test30 {
    private String name;
    private Test29[] products;

    void setName(String name1) {
        name = name1;
    }

    String getName() {
        return name;
    }

    void setProducts(Test29[] p) {
        products = p;
    }

    Test29[] getProducts() {
        return products;
    }

    Test29 sell(Test29 p) {
        for (int i = 0; i < products.length; i++) {
            if (products[i].getName()==p.getName()) {
                return products[i];
            }
        }
        return null;
    }
}
